package com.glsc.ngateway.common.base.domainmapper.cmdb;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow.cmdb.FlowFormDeviceIn;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.cmdb.domainDto.FlowFormDeviceInDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: zhengyr
 * @Desc: domin到dto转换
 */
@Mapper(componentModel = "spring")
public interface FlowFormOuterDeviceInMapper {

    FlowFormOuterDeviceInMapper INSTANCE = Mappers.getMapper(FlowFormOuterDeviceInMapper.class);

    @Mapping(target = "appendicesFileList", ignore = true)
    FlowFormDeviceInDto domain2dto(FlowFormDeviceIn domain);

    List<FlowFormDeviceInDto> domain2dto(List<FlowFormDeviceIn> domain);

    @Mapping(target = "appendicesFileIdList", ignore = true)
    @Mapping(target = "insertTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    FlowFormDeviceIn dto2domain(FlowFormDeviceInDto dto);

    List<FlowFormDeviceIn> dto2domain(List<FlowFormDeviceInDto> dto);
}
